home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #6 / utv2n6s1.d64 / adding decimals (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  13KB  |  395 lines

  1. 1 if a=0 then a=1:load"chr v2",8,1
  2. 2 if a=1 then a=2:load"vision",8,1
  3. 3 poke 56,104:clr
  4. 5 rem *** adding decimals ***
  5. 9 poke 53265,peek(53265) and 239
  6. 10 poke 53280,0:poke 53281,0
  7. 11 poke 53272,(peek(53272)and 15)or 176
  8. 12 poke 56576,(peek(56576)and252)or 2
  9. 13 poke 53272,(peek(53272)and 240)or 12
  10. 14 poke 648,108:print"[147]";:poke 53265,peek(53265) or 16
  11. 15 poke 28664,160:poke 28665,161
  12. 16 for z=54272 to 54296:poke z,.:next
  13. 17 gosub 3500:poke 198,0
  14. 18 get a$:if a$<>" " then 18
  15. 19 gn$="[193]dding [196]ecimals"
  16. 20 for z=54272 to 54296:poke z,.:next:ford=1to6:readre$(d):next
  17. 25 data "[199]reat!","[198]antastic!","[211]uper!","[217]ou've got it!"
  18. 26 data "[217]es! [217]es! [217]es!","[212]hat's [199]reat!"
  19. 28 forx=0to7:reada:poke30936+x,a:poke31056+x,peek(29320+x):next
  20. 30 data 0,128,192,224,240,224,192,128
  21. 32 forx=0to15:reada:poke30944+x,a:next
  22. 34 data 255,127,63,31,15,31,63,127,255,254,252,248,240,248,252,254
  23. 50 dimnm$(15):ford=0to10:readnm$(d):next
  24. 52 data "[172][192][187][157][157][157][221] [221][157][157][157][188][192][190]"
  25. 54 data " [174][157][221][157][157] [177] "
  26. 56 data "[172][192][187][157][157][157][172][192][190][157][157][157][173][192][189]"
  27. 58 data "[172][192][187][157][157][192][179][157][157][157][188][192][190]"
  28. 60 data "[174][157][173][219][157][177]"
  29. 62 data "[176][192][187][157][157][157][173][192][187][157][157][157][173][192][190]"
  30. 64 data"[172][192][187][157][157][157][171][192][187][157][157][157][188][192][190]"
  31. 66 data"[176][192][174][157][157][172][190][157][157][177]"
  32. 68 data"[172][192][187][157][157][157][171][192][179][157][157][157][188][192][190]"
  33. 70 data"[172][192][187][157][157][157][188][192][179][157][157][157][188][192][190]"
  34. 74 data"[223][169][146][157][157]\][157][157][169][223]"
  35. 80 fora=6to2step-1:readpl$(a):nexta
  36. 85 data "thousandths","hundredths","tenths","","ones"
  37. 95 goto 2000
  38. 100 rem *** zippy titles ***
  39. 105 rem ln=line# to place text
  40. 110 poke646,11:letlc=(23-ln)/3
  41. 115 tb=(40-len(tx$))/2
  42. 120 ford=23tolnstep-1:print"";
  43. 125 ford1=1tod:print"";:nextd1
  44. 130 ifd/6=int(d/6)then gosub165
  45. 135 printtab(tb)tx$
  46. 140 nextd
  47. 145 ford=23toln+1step-1:print"";
  48. 150 ford1=1tod:print"";:next
  49. 155 printtab(11)"                          "
  50. 160 next:return
  51. 165 ifpeek(646)=15thenpoke646,1
  52. 170 ifpeek(646)=12thenpoke646,15
  53. 175 ifpeek(646)=11thenpoke646,12
  54. 180 return
  55. 200 rem ***        clear          ***
  56. 210 for er=lnto24:poke 781,er:sys 59903:next:return
  57. 300 rem
  58. 305 rem ***     reward sound      ***
  59. 310 rem
  60. 320 poke 53280,2:poke 53281,2
  61. 325 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  62. 330 for d=1 to 25:next
  63. 332 poke 53280,5:poke 53281,5
  64. 335 s=54279:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  65. 340 for d=1 to 25:next
  66. 342 poke 53280,6:poke 53281,6
  67. 345 s=54286:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  68. 350 for d=1 to 25:next
  69. 352 poke 53280,0:poke 53281,0
  70. 355 sc=sc+1
  71. 365 return
  72. 405 rem *** get numeric input from ***
  73. 410 rem ***     user for use in    ***
  74. 415 rem ***     working problem    ***
  75. 420 rem
  76. 425 open1,0:input#1,j$:close1,0
  77. 430 j=val(j$)
  78. 435 return
  79. 480 rem *** print screen header ***
  80. 481 print"[147]":poke53287,2:poke53288,12:poke53248,40:poke53249,56:poke 53250,40
  81. 482 poke 53251,56
  82. 485 forx=0to1:poke53277,peek(53277)or(2^x):poke 53271,peek(53271)or(2^x)
  83. 490 poke 53269,peek(53269)or(2^x):nextx
  84. 495 return
  85. 499 forx=0to2:poke53269,peek(53269)and(255-2^x):nextx:return
  86. 500 rem ** short wrong sound **
  87. 505 n$="028":s=54272:pokes+6,96:pokes+24,15
  88. 510 forq=1to6 step3
  89. 515 pokes+1,val(mid$(n$,q,2)):pokes+4,33
  90. 520 forjw=1tot*val(mid$(n$,q+2,1)):next:forr=1to100:next
  91. 525 pokes+4,0:next:return
  92. 600 rem
  93. 605 rem *** general purpose delay ***
  94. 610 rem
  95. 615 for d=1 to 1300:next
  96. 620 return
  97. 625 return
  98. 800 rem *** title box ***
  99. 805 print"";
  100. 810 print"[159][192][157][157][156][183][183][145][145]";
  101. 815 forx=1to23:print"[154][175][157][159][192][157][156][183][145][145]";:next
  102. 820 print"[154][175][175][157][157][159][192]":return
  103. 850 print"[154]";:goto 855
  104. 851 print"[150]";
  105. 855 print"";
  106. 860 print"   [172][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][187]"
  107. 865 forjw=1to3:print"   [221][221]":next
  108. 870 print"   [188][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][190]"
  109. 880 return
  110. 900 print"";:ford=1to24:print"";:next
  111. 905 print"[159][169][208]ress [210][197][212][213][210][206] to [195]ontinue or _ to [197]xit[146][169][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][145][145][145]"
  112. 925 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  113. 927 poke 198,0
  114. 930 getrc$:ifrc$=""then930
  115. 940 ifrc$="_"thencp=cp+1:goto 4000
  116. 950 ifrc$<>chr$(13)then930
  117. 960 return
  118. 980 print"";:forjg=1toy:print"";:nextjg:printtab(x);tx$;:return
  119. 990 x=(40-len(tx$))/2:goto980
  120. 1100 rem *** wrong sound ***
  121. 1105 n$="042034":s=54272:pokes+6,96:pokes+24,15
  122. 1110 forq=1to6 step3
  123. 1115 pokes+1,val(mid$(n$,q,2)):pokes+4,33
  124. 1120 forjw=1tot*val(mid$(n$,q+2,1)):next:forr=1to300:nextr
  125. 1125 pokes+4,0:nextq:return
  126. 1200 rem *** change color of number ***
  127. 1205 co=3:goto 1215
  128. 1210 co=1
  129. 1215 b1=55296:b2=b1+x+(y*40)
  130. 1220 forr=1to3:forq=0to2:pokeb2+q,co:nextq:b2=b2+40:nextr:return
  131. 1300 rem *** place number at x,y ***
  132. 1305 nu$=str$(nu):foraa=1tolen(nu$)
  133. 1310 tp$=mid$(nu$,aa,1):iftp$=" "then1325
  134. 1315 iftp$="."thentx$="*":y=y+2:gosub980:y=y-2:x=x+1:goto1325
  135. 1320 tx$=nm$(val(tp$)):gosub980:x=x+3
  136. 1325 nextaa:return
  137. 1400 rem *** place number slowly ***
  138. 1404 nu$=str$(nu)
  139. 1405 xx=x:print"[159]";:foraa=len(nu$)to1step-1
  140. 1410 tp$=mid$(nu$,aa,1):iftp$=" "then1425
  141. 1415 iftp$="."thentx$="*":x=x+2:y=y+2:gosub980:y=y-2:x=x-3:goto1422
  142. 1420 tx$=nm$(val(tp$)):gosub980:x=x-3
  143. 1422 fordd=1to300:nextdd
  144. 1425 nextaa:fordd=1to300:nextdd
  145. 1430 forx=xxto(xx-(3*len(nu$)))step-3:gosub1210:next:print"";:return
  146. 1500 rem *** option 2 input routine ***
  147. 1504 nu$=str$(nu)
  148. 1505 ot$="":fortp=len(nu$)to2step-1:wa=0
  149. 1507 poke 198,0
  150. 1510 geta$:ifa$=""thentx$="[159][176][192][174][157][157][157][221] [221][157][157][157][173][192][189]":gosub980
  151. 1511 ifa$=""thentx$="   [157][157][157]   [157][157][157]   ":gosub980:goto 1510
  152. 1512 a=val(a$):ifmid$(nu$,tp,1)="."anda$<>"."andop=3then1510
  153. 1513 ifa$="."then1517
  154. 1515 ifa<0ora>9then1510
  155. 1516 ifop=3then1526
  156. 1517 ifa$=mid$(nu$,tp,1)then1525
  157. 1518 gosub500:wa=wa+1:ifwa=3then1525
  158. 1520 goto 1510
  159. 1525 ifa$="."thentx$="*":y=y+2:x=x+2:gosub980:x=x-3:y=y-2:goto1527
  160. 1526 ifa$<>"."andop=2thentx$=nm$(val(mid$(nu$,tp,1))):gosub980:x=x-3
  161. 1527 ifa$<>"."andop=3thentx$=nm$(val(a$)):gosub980:x=x-3
  162. 1528 ax=x:ay=y:iftp=len(nu$)andcn$<>""thentx$=cn$:x=30:y=5:gosub980:cn$=""
  163. 1529 x=ax:y=ay
  164. 1530 ot$=a$+ot$:next:return
  165. 2000 rem
  166. 2005 rem ***   main program   ***
  167. 2010 rem
  168. 2015 print"[147]";:gosub480:ln=1:tx$="[193]dding [196]ecimals":gosub 100:gosub800
  169. 2020 x=0:y=10
  170. 2025 tx$="[196]o you want instructions? [145][164][164][164][164][164][157][157][157][157][157][165][217]/[206][167][157][157][157][157][157][163][163][163][163][163][145] "
  171. 2027 tx$=tx$+"       [157][157][157][157][157][157][157]":gosub 980
  172. 2030 mx=1:gosub3000:i$=t$:ifi$="y"thengosub30000
  173. 2035 ifi$<>"n"andi$<>"y"thenprint"[145]";:goto2025
  174. 2038 ln=5:gosub200
  175. 2040 y=10:x=0:tx$="[215]hat is your name? "
  176. 2045 gosub 980:mx=16:gosub 3000:nn$=t$:gosub200
  177. 2050 x=0:y=10:tx$="[215]hich option do you want:"
  178. 2053 gosub 980
  179. 2055 tx$="   1.  [196]emonstration.":y=12:gosub980
  180. 2060 tx$="   2.  [215]ork [197]xamples with [200]elp.":y=13:gosub980
  181. 2065 tx$="   3.  [211]tep-by-[211]tep [208]roblems.":y=14:gosub980
  182. 2068 tx$="   4.  [193]nswers [207]nly.":y=15:gosub980
  183. 2069 tx$="[217]our choice? [145][164][164][164][164][164][157][157][157][157][157][165]1-4[167][157][157][157][157][157][163][163][163][163][163][145] ":y=17
  184. 2070 gosub980:mx=1:gosub3000
  185. 2071 op=val(t$):ifop>1thennp$="[145][164][164][164][164][164][164][157][157][157][157][157][157][165]5-20[167][157][157][157][157][157][157][163][163][163][163][163][163][145] ":